<!-- author: 薛皓文 -->
<!-- date: 2024-11-27 21:31:35 -->
<!-- description: 二次封装 uni-combox  -->
<template>
<uni-combox  v-bind="_$attrs()" v-on="_listeners()"  v-model="modelValue"></uni-combox>
    
  
</template>
<script setup>
import {
    reactive,
    toRefs,
    ref,
    getCurrentInstance,
    computed,
    watch
} from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import dayjs from 'dayjs';
import globalHook from "@/hooks/globalHook.js"
const globalHookObj = globalHook();
const { _$attrs } = toRefs(globalHookObj);
//传参
const $props = defineProps({
    modelValue: {
        //所有类型
        type: [Number, String, Boolean, Array, Object, Function],
        default: () => {
            return undefined;
        },
    },
});
const {
    formType,
} = toRefs($props);
//TODO hooks提出双向绑定
const $emit = defineEmits(["update:modelValue"  ]);
//双向绑定
const modelValue = computed({
    get() {
        return $props.modelValue;
    },
    set(value) {
        $emit("update:modelValue", value);
    },
});
//多层调用组件的方法
const _listeners = computed(() => (excludeListeners = []) => {


let $listeners = $props.listeners || {};
let newListeners = {};
// 不需要的属性名
const _excludeListeners = excludeListeners;
// 遍历 $listeners

for (const key in $listeners) {
    if (Object.hasOwnProperty.call($listeners, key)) {
        const element = $listeners[key];

        if (!_excludeListeners.includes(key)) {
            newListeners[key] = element;
        }
    }
}

return newListeners;
});

 
</script>
<style lang="scss" scoped>
.container {}
</style>

 